package com.bj.dz.controller;

import com.bj.dz.entity.WatersupplyBackbonedata;
import com.bj.dz.service.WatersupplyBackbonedataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/***
*   控制器
*/
@Slf4j
@Api(tags = "【WatersupplyBackbonedata】提供服务接口")
@RestController
@RequestMapping("/watersupplyBackbonedata")
public class WatersupplyBackbonedataController {

    @Resource
    private WatersupplyBackbonedataService watersupplyBackbonedataService;

    /**
    * 通过id查询
    * @param
    * @return
    */
    @ApiOperation(value = "查找服务")
    @RequestMapping(value="/findById",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public WatersupplyBackbonedata findWatersupplyBackbonedataById(@ApiParam(name = "id",value = "WatersupplyBackbonedata的id",required = true) @RequestParam(value = "id",required=true)Integer id){
        return watersupplyBackbonedataService.getWatersupplyBackbonedataById(id);
    }

    /**
    * 通过多个查询
    * @param
    * @return
    */
    @ApiOperation(value = "查找多个服务")
    @RequestMapping(value="/findWatersupplyBackbonedatas",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public List<WatersupplyBackbonedata> findWatersupplyBackbonedataListByMap(@ApiParam(name = "WatersupplyBackbonedata",value = "watersupplyBackbonedata",required = true)@RequestBody WatersupplyBackbonedata watersupplyBackbonedata){

        return watersupplyBackbonedataService.getWatersupplyBackbonedataListByMap(null);
    }

    /**
    * 查询总数
    * @param
    * @return
    */
    @ApiOperation(value = "获取总数服务")
    @RequestMapping(value="/count",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public Integer WatersupplyBackbonedataCount(){
        return watersupplyBackbonedataService.getWatersupplyBackbonedataCountByMap(null);
    }

    /**
    * 添加保存
    * @param
    * @return
    */
    @ApiOperation(value = "添加服务")
    @RequestMapping(value="/add",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean addWatersupplyBackbonedata(@ApiParam(name = "WatersupplyBackbonedata",value = "watersupplyBackbonedata对象",required = true)@RequestBody WatersupplyBackbonedata watersupplyBackbonedata){
            return watersupplyBackbonedataService.addWatersupplyBackbonedata(watersupplyBackbonedata);
    }

    /**
    * 更新修改
    * @param
    * @return
    */
    @ApiOperation(value = "更新修改服务")
    @RequestMapping(value="/upd",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean modifyWatersupplyBackbonedata(@ApiParam(name = "WatersupplyBackbonedata",value = "watersupplyBackbonedata对象",required = true)@RequestBody WatersupplyBackbonedata watersupplyBackbonedata){
        return watersupplyBackbonedataService.modifyWatersupplyBackbonedata(watersupplyBackbonedata);
    }

    /**
    * 删除
    * @param
    * @return
    */
    @ApiOperation(value = "删除服务")
    @RequestMapping(value="/del",method = RequestMethod.POST, produces = "application/json;" +"charset=UTF-8")
    public boolean deleteWatersupplyBackbonedataById(@ApiParam(name = "WatersupplyBackbonedata",value = "watersupplyBackbonedata的id",required = true) @RequestParam(value = "id",required=true)Integer id){
        return watersupplyBackbonedataService.deleteWatersupplyBackbonedataById(id);
    }



}
